// 我的钱包点击后显示的页面
import React, {Component} from "react";
import {
  View,
  Text,
  Button,
  StyleSheet,
  Image,
  TouchableOpacity,
} from 'react-native';
import ContentAlign from './ContentAlign';//我的钱包里面的共用组件
// import MyScreen from './AllAssets';//总易积分
// import CashBalance from './CashBalance';//现金余额

// import PlanNavi from './MyProductPlan';

import { StackNavigator } from 'react-navigation';

const styles = StyleSheet.create({
  container: {
    // flex: 1,
    height:'37%',
  	backgroundColor: '#e4393c',
  },
  doubleButton: {
  	flexDirection:'row',
  	alignItems: 'center',  
  	justifyContent: 'center',
    paddingTop: '5%',
  },
  touch: {
  	width: '50%',
  	alignItems: 'center',      // 水平局中
    justifyContent: 'center',  // 垂直居中
  },
  touchPress: {
  	borderWidth: 1,
  	borderColor: '#fff8dc',
  	borderRadius: 4,
  	alignItems: 'center',      // 水平局中
    justifyContent: 'center',  // 垂直居中
    paddingTop: 5,
    paddingBottom: 5,
    paddingLeft: 18,
    paddingRight: 18,
  },
  touchText: {
  	fontSize: 16,
  	color: '#fff',
  },

});

class DoubleButton extends React.Component{
	render(){
		return (
			<View style={styles.doubleButton}>
				<TouchableOpacity style={styles.touch}
					onPress={() => this.props.navigation.navigate('allAssets')}
				>
				<View style={styles.touchPress}>
					<Text style={styles.touchText}>总易积分</Text>
					<Text style={styles.touchText}>1346.0</Text>
				</View>	
				</TouchableOpacity>

				<TouchableOpacity style={styles.touch}
					onPress={() => this.props.navigation.navigate('cashBalance')}
				>
					<View style={styles.touchPress}>
						<Text style={styles.touchText}>现金余额</Text>
						<Text style={styles.touchText}>0.0</Text>
					</View>
				</TouchableOpacity>
			</View>
		);
	}
}

class MyWallet extends React.Component{
	render(){
		return(
  		<View style={styles.container}>
  				<View style={{flex:10}}>
  					<ContentAlign />
  					<DoubleButton {...this.props} />
  				</View>
       
			</View>
		);
	}
}

// const WalletApp = StackNavigator({
//   Home: {
//     screen: MyWallet,
//   },
//   AllYijifen: {
//     screen: MyScreen,
//   },
//   CashBalance: {
//   	screen: CashBalance,
//   }
// });

export default MyWallet;

